<!DOCTYPE html>
<!--suppress ALL-->
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>房源信息修改页-房东</title>
    <link rel="stylesheet" th:href="@{/assets/css/styles.css}">
    <link rel="stylesheet" th:href="@{/assets/css/colors.css}">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" crossorigin="anonymous">
    <link rel="stylesheet" th:href="@{/assets/css/styles.css}">
    <script th:src="@{/assets/js/jquery.min.js}"></script>
    <script th:src="@{/assets/js/popper.min.js}"></script>
    <script th:src="@{/assets/js/bootstrap.min.js}"></script>
    <script th:src="@{/assets/js/custom.js}"></script>
    <script th:src="@{/assets/js/daterangepicker.js}"></script>
    <script th:src="@{/assets/js/dropzone.js}"></script>
    <script th:src="@{/assets/js/imagesloaded.js}"></script>
    <script th:src="@{/assets/js/ion.rangeSlider.min.js}"></script>
    <script th:src="@{/assets/js/jquery.magnific-popup.min.js}"></script>
    <script th:src="@{/assets/js/lightbox.js}"></script>
    <script th:src="@{/assets/js/markerclusterer.js}"></script>
    <script th:src="@{/assets/js/moment.min.js}"></script>
    <script th:src="@{/assets/js/morris.min.js}"></script>
    <script th:src="@{/assets/js/raphael.min.js}"></script>
    <script th:src="@{/assets/js/select2.min.js}"></script>
    <script th:src="@{/assets/js/slick.js}"></script>
    <script th:src="@{/assets/js/slider-bg.js}"></script>
    <link rel="stylesheet" th:href="@{/assets/css/colors.css}">
    <link rel="stylesheet" th:href="@{/assets/plugins/bootstrap-fileinput/css/fileinput.min.css}">
</head>
<body id="body">
    <!-- 复用首页头部 -->
    <header th:replace="index::header"></header>
    <!-- 提示框信息 -->
    <div th:replace="point-modal::modal"></div>
    <!-- 发布房源信息，填写相关内容 -->
    <div class="container"  style="margin-bottom: -20px; height: 695px;overflow: auto;">
        <!-- 个人信息页 -->
        <section class="p-0">
            <div class="container-fluid p-0">
                <div class="row">
                    <!-- 右侧信息页 -->
                    <div class="col-lg-12 col-md-8 col-sm-12" style="height:695px;overflow:auto;">
                        <section style="padding-top: 10px">
                            <div class="container">
                                <div class="row">
                                    <!-- 表单提交 -->
                                    <form id="houseForm" th:action="@{/updateHouseInfo}" method="post" enctype="multipart/form-data">
                                        <input hidden="hidden" id="id" name="id" th:value="${house.id}">
                                        <div class="col-lg-12 col-md-12">
                                            <div class="submit-page form-simple">
                                                <div class="frm_submit_block">
                                                    <h3>基本信息<span style="color: red">*</span></h3>
                                                    <div class="form-row">
                                                        <div class="form-group col-md-4">
                                                            <label>出租类型</label>
                                                            <select name="rentType" class="form-control">
                                                                <option value="whole" th:selected="${house.rentType == 'whole'}">整租</option>
                                                                <option value="share" th:selected="${house.rentType == 'share'}">合租</option>
                                                            </select>
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>月租金<a href="#" class="tip-topdata" data-tip="日租金 = 月租金/30"><i class="ti-help"></i></a></label>
                                                            <input type="number" name="monthRent" class="form-control" th:value="${house.monthRent}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>所属城市</label>
                                                            <input type="text" name="city" class="form-control" th:value="${house.city}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>房子标题信息<a href="#" class="tip-topdata" data-tip="如：合租-世界花园-4居室-A卧"><i class="ti-help"></i></a></label>
                                                            <input type="text" name="title" class="form-control" th:value="${house.title}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>房子详细地址信息<a href="#" class="tip-topdata" data-tip="如：广东省深圳市南山区世界之窗世纪花园小区88栋808室A卧"><i class="ti-help"></i></a></label>
                                                            <input type="text" name="address" class="form-control" th:value="${house.address}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>
                                                                经纬度坐标/
                                                                <a href="https://api.map.baidu.com/lbsapi/getpoint/index.html" target="_blank">点击获取</a>
                                                                <a href="#" class="tip-topdata" data-tip="如：113.12345, 22.56777777"><i class="ti-help"></i></a></label>
                                                            <input type="text" name="longitudeLatitude" class="form-control" th:value="${house.longitudeLatitude}">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="frm_submit_block">
                                                    <h3>结构信息<span style="color: red">*</span></h3>
                                                    <div class="form-row">
                                                        <div class="form-group col-md-4">
                                                            <label>房产证号</label>
                                                            <input type="text" name="certificateNo" class="form-control" id="certificateNo" th:value="${house.certificateNo}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>面积<a href="#" class="tip-topdata" data-tip="整租类型为整个房子的面积，合租类型为单间的面积，单位为平方米"><i class="ti-help"></i></a></label>
                                                            <input type="text" name="area" class="form-control" th:value="${house.area}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>朝向</label>
                                                            <input type="text" name="direction" class="form-control" th:value="${house.direction}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>是否有空调</label>
                                                            <select name="hasAirConditioner" class="form-control">
                                                                <option value="1" th:selected="${house.hasAirConditioner==1?'selected':''}">有</option>
                                                                <option value="0" th:selected="${house.hasAirConditioner==0?'selected':''}">无</option>
                                                            </select>
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>卧室数量</label>
                                                            <input type="number" name="bedroomNum" class="form-control" th:value="${house.bedroomNum}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>客厅数量</label>
                                                            <input type="number" name="livingRoomNum" class="form-control" th:value="${house.livingRoomNum}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>厨房数量</label>
                                                            <input type="number" name="kichenNum" class="form-control" th:value="${house.kichenNum}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>卫生间数量</label>
                                                            <input type="number" name="toiletNum" class="form-control" th:value="${house.toiletNum}">
                                                        </div>
                                                    </div>

                                                </div>
                                                <div class="frm_submit_block">
                                                    <h3>建筑信息</h3>
                                                    <div class="form-row">
                                                        <div class="form-group col-md-4">
                                                            <label>建成年份</label>
                                                            <input type="number" name="buildYear" class="form-control" th:value="${house.buildYear}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>所在楼层</label>
                                                            <input type="number" name="floor" class="form-control" th:value="${house.floor}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>总楼层</label>
                                                            <input type="number" name="maxFloor" class="form-control" th:value="${house.maxFloor}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>是否有电梯</label>
                                                            <select name="hasElevator" class="form-control">
                                                                <option value="1" th:selected="${house.hasElevator==1?'selected':''}">有</option>
                                                                <option value="0" th:selected="${house.hasElevator==0?'selected':''}">无</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="frm_submit_block">
                                                    <h3>联系人信息<span style="color: red">*</span></h3>
                                                    <div class="form-row">
                                                        <div class="form-group col-md-4">
                                                            <label>联系人姓名</label>
                                                            <input type="text" name="contactName" class="form-control" th:value="${house.contactName}">
                                                        </div>
                                                        <div class="form-group col-md-4">
                                                            <label>联系人电话</label>
                                                            <input type="text" name="contactPhone" class="form-control" th:value="${house.contactPhone}">
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="frm_submit_block">
                                                    <h3>详细描述</h3>
                                                    <div class="form-row">
                                                        <div class="form-group col-md-12">
                                                            <textarea class="form-control ht-120" name="content" th:utext="${house.content}"></textarea>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="frm_submit_block">
                                                    <h3>轮播图上传<a href="#" class="tip-topdata" data-tip="注意：新上传的图片会将之前的覆盖，请上传所有您需要的图片；如果不上传，则沿用之前图片"><i class="ti-help"></i></a></h3>
                                                    <div class="form-row">
                                                        <div class="form-group col-md-12">
                                                            <input type="file" name="file" id="file" multiple class="file-loading">
                                                        </div>
                                                    </div>
                                                </div>
                                                <!-- 提交按钮 -->
                                                <div class="form-group">
                                                    <div class="col-lg-12 col-md-12">
                                                        <button class="btn btn-theme bg-2" type="submit" id="addHouseBtn">修改</button>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </section>
                    </div>
                </div>
            </div>
        </section>
    </div>
    <!-- 复用首页底部 -->
    <div th:replace="index::footer"></div>

<script th:src="@{/assets/plugins/bootstrap-fileinput/js/fileinput.min.js}"></script>
<script th:src="@{/assets/plugins/bootstrap-fileinput/js/locales/zh.js}"></script>
<script th:inline="javascript">
    $(function () {
        var timestamp = Date.parse(new Date());
        $("#file").fileinput({
            language:'zh',      // 设置语言
            allowedFileExtensions:['png', 'jpg', 'jpeg', 'gif'],    // 允许上传的格式
            showUpload:false,
            showCaption:false,
        });
        var addHouseResult = [[${msg}]];
        if(addHouseResult != null && addHouseResult != undefined && addHouseResult != '') {
            $("#myModalBody").text(addHouseResult);
            $("#myModal").prop("hidden", "");
            setTimeout(function () {
                $("#myModal").prop("hidden", "hidden");
            }, 1000);
        }
    })
</script>

</body>
</html>